package DAO;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class AdminDao {
	@Autowired
	JdbcTemplate jdbcTemplate;
	public boolean isValid(String RFID){
		String isAdminValidSQL = "select count(admin_id) from admin where admin_rfid=?";
		Object[] params=new Object[]{RFID};
		int result=jdbcTemplate.queryForInt(isAdminValidSQL,params);
		if(result==1){
			return true;
		}else{
			return false;
		}
	}
}
